package fractal.model;

/** Class testing time action */
public class TimeTest {

	private long startTime;
	private long stopTime;

	/** constructor */
	public TimeTest() {
		this.startTime = 0L;
		this.stopTime = 0L;
	}

	/** method save start time */
	public void start() {
		this.startTime = System.nanoTime();
	}

	/** method save stop time */
	public void stop() {
		this.stopTime = System.nanoTime();
	}

	/** method get delta time as long */
	public long getDelta() {
		return this.stopTime - this.startTime;
	}

	/** method get delta time as string */
	public String getString() {
		return String.format("%4.4f ms.", ((double) this.getDelta() / 1000000));
	}
}
